package com.nervenets.template.controller.data;

import com.nervenets.general.entity.ResponsePageResult;
import com.nervenets.general.entity.ResponseResult;
import com.nervenets.general.exception.LogicException;
import com.nervenets.general.jwt.aspect.JwtRole;
import com.nervenets.general.jwt.aspect.JwtSecurity;
import com.nervenets.general.web.BaseEntityController;
import com.nervenets.general.web.params.IdsParams;
import com.nervenets.template.controller.data.params.DataOfUserFormParams;
import com.nervenets.template.controller.data.params.DataOfUserPagingParams;
import com.nervenets.template.hibernate.domain.data.DataOfUser;
import com.nervenets.template.service.DataOfUserService;
import io.swagger.annotations.Api;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

@Api(value = "用户统计接口v1", tags = "用户统计相关接口")
@RestController
@RequestMapping("/api/user/data")
@JwtRole(group = "users", groupName = "用户管理", function = "data", functionName = "用户统计", queue = 11)
public class DataOfUserController extends BaseEntityController<DataOfUser, DataOfUserService, DataOfUserFormParams, DataOfUserPagingParams, DataOfUser, DataOfUser> {
    @Override
    @JwtSecurity(permission = "list", permissionName = "列表", queue = 200)
    public ResponseEntity<ResponsePageResult<DataOfUser>> list(@Valid @RequestBody DataOfUserPagingParams params, HttpServletRequest request, HttpServletResponse response) {
        return super.list(params, request, response);
    }

    @Override
    public ResponseEntity<ResponseResult<DataOfUser>> edit(@Valid @RequestBody DataOfUserFormParams params, HttpServletRequest request, HttpServletResponse response) {
        throw new LogicException("not support");
    }

    @Override
    public ResponseEntity<ResponseResult<Void>> del(@Valid @RequestBody IdsParams params, HttpServletRequest request, HttpServletResponse response) {
        throw new LogicException("not support");
    }
}
